package com.softserveinc.dao.mapper;

import com.softserveinc.model.User;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * User row mapper
 */
public class UserRowMapper implements RowMapper<User> {
    /**
     *
     * @param resultSet - queried RS
     * @param i - row index
     * @return extracted User data from RS
     * @throws SQLException
     */
    @Override
    public User mapRow(ResultSet resultSet, int i) throws SQLException {
        UserResultSetExtractor extractor = new UserResultSetExtractor();
        return extractor.extractData(resultSet);

    }
}
